home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / PDOS / TN.PDOS.026 < prev    next >
Encoding:
Text File  |  1990-01-09  |  5.7 KB  |  117 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. ProDOS 8
  8. #26:    Polite Use of Auxiliary Memory
  9.  
  10. Written by:    Matt "Missed Manners" Deatherage                  January 1990
  11.  
  12. This Technical Note discusses the use of auxiliary memory, particularly the 
  13. reserved areas, and this information supersedes the discussion in the ProDOS 8 
  14. Technical Reference Manual.
  15. _____________________________________________________________________________
  16.  
  17.  
  18. "I want to use auxiliary memory!"
  19.  
  20. Dear Missed Manners:
  21.  
  22. I'm having difficulty in a program I'm writing for 128K Apple II computers.  
  23. My program is about to run out of memory.  I have squeezed, packed and 
  24. compressed this program until I can simply cajole no more room from it, and 
  25. yet more room it needs.  Apple has a large section of memory reserved, but my 
  26. investigations reveal that this memory (in a language card, where it is doubly 
  27. valuable since it stays put when main memory is swapped) seems to be unused.  
  28. The ProDOS 8 Technical Reference Manual  states unfailingly that the memory 
  29. must not be used, but it seems to be wasting away!  How can I politely use 
  30. this valuable resource in my own application?
  31.  
  32. Gentle Developer:
  33.  
  34. Polite programming requires cooperation by both developers and system 
  35. software, and it is the users who suffer when that cooperation is not 
  36. maintained.  Apple reserves memory for system software so that it can expand 
  37. without breaking applications.  Missed Manners hopes that he is not being too 
  38. presumptuous by assuming that you would be appalled if Apple was required to 
  39. expand ProDOS 8 and reclaim the memory from $B000 through $BFFF.  He notes 
  40. this situation would not be necessary if Apple were able to use memory it 
  41. currently has reserved for such purposes.
  42.  
  43. However, if necessity requires more memory for your application, a polite 
  44. inquiry to Apple may be sent.  "Would it be possible for me to use some of 
  45. Apple's reserved memory in my application without compatibility problems?" 
  46. would be a polite request, for example.  Using the memory without asking or 
  47. demanding action would not  only be impolite, it would pose future problems 
  48. for an application.  Those who do not program politely will eventually regret 
  49. such a decision.
  50.  
  51.  
  52. Conflicts and Arbitration
  53.  
  54. Some of the polite letters Apple has received on this subject point out that 
  55. the built-in /RAM device uses almost all of the memory marked as "reserved" in 
  56. the ProDOS 8 memory map.  How can the system software expand into areas it's 
  57. already using?
  58.  
  59. It can't, of course...unless it already has and you don't know it.  This is 
  60. partially the case.  On the Apple IIGS, memory can be obtained through the 
  61. Memory Manager, so adding new components to the system software is relatively 
  62. easy.  If memory is available, it is allocated by the Memory Manager and used 
  63. by the application.  If memory is not available, the program trying to install 
  64. the component in question is told and the component is not installed.  (If a 
  65. vital part of the system can't be installed, the boot process grinds to an 
  66. unceremonious, but grammatically correct, halt.)
  67.  
  68. Since the 8-bit Apple II family has no memory manager, applications and system 
  69. software must mutually (and politely) agree which areas of memory belong to 
  70. whom.  If the system software is broken into components, some memory will be 
  71. reserved for components which are not present at a given time.  This is 
  72. largely the case with the auxiliary language card memory on the 128K AppleĀ II.
  73.  
  74. The area from $D100 through $DFFF in bank 2 of the auxiliary language card is 
  75. for the use of third-party RAM-based drivers, to be discussed in a future 
  76. ProDOS 8 Technical Note.  At least one version of Apple II SANE is configured 
  77. to load at $E000 in the auxiliary language card, which is perfectly acceptable 
  78. since SANE is part of the system software (it just doesn't ship with the 
  79. system).
  80.  
  81. Clearly, /RAM can't use this memory at the same time the system software does.  
  82. This very dichotomy gives the Rule of Auxiliary Memory that simplifies this 
  83. memory management.
  84.  
  85.         The Rule of Auxiliary Memory:  If /RAM is enabled, all 
  86.         auxiliary memory above location $800 may be used by an application 
  87.         after first removing /RAM as discussed in the ProDOS 8 Technical 
  88.         Reference Manual.  /RAM should be reinstalled upon completion.
  89.  
  90.         If /RAM is not enabled, then auxiliary memory above $800 may be 
  91.         used at the application programmer's discretion, but the areas 
  92.         marked as reserved must be respected.
  93.  
  94. System software use of this area should be denoted by the absence of /RAM.  
  95. This means that if ProDOS 8 were to ever expand to run only on 128K machines 
  96. and require auxiliary language card memory, that no /RAM device would be 
  97. installed by default.  Although this seems unlikely, it is nonetheless another 
  98. indicator that your application should not depend on /RAM to operate.
  99.  
  100. Similarly, if /RAM is not present when your application is launched, you may 
  101. not reenable it.  If it is present, you may remove it to use the memory if 
  102. you reinstall it when you're done.
  103.  
  104. Also note that auxiliary memory below $800 that is not on the 80-column text 
  105. screen is always reserved and may never be used by applications.
  106.  
  107. Applications which use reserved memory areas without observing this rule run 
  108. the risk of storing data over third-party RAM-based drivers (rendering their 
  109. software useless to peripherals that may require such drivers, like third-
  110. party networks, devices for the visually impaired, or closed-system hard 
  111. disks) or future system software.
  112.  
  113.  
  114. Further Reference
  115. _____________________________________________________________________________
  116.   o  ProDOS 8 Technical Reference Manual
  117.